package com.edittable.util;

import java.io.IOException;
import java.io.Reader;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public class IbtisUtil {
	private static SqlMapClient sqlmap;
	static {
		Reader reader = null;
		try {
			reader = Resources.getResourceAsReader("SqlMapConfig.xml");
			sqlmap=SqlMapClientBuilder.buildSqlMapClient(reader);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{
			try {
				reader.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
	public static SqlMapClient getSqlMap(){
		return sqlmap;
	}

}
